package cc.shacocloud.luanniao.core.service.ai

import cc.shacocloud.luanniao.core.model.constant.AiModelTypeEnum
import cc.shacocloud.luanniao.core.service.ai.doubao.DoubaoAiOptions
import com.fasterxml.jackson.annotation.JsonSubTypes
import com.fasterxml.jackson.annotation.JsonTypeInfo
import jakarta.validation.Valid

/**
 * ai 模型配置的父类
 *
 * @author 思追(shaco)
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type")
@JsonSubTypes(
    JsonSubTypes.Type(value = DoubaoAiOptions::class, name = "DOUBAO"),
)
abstract class AiOptions(

    /**
     * 模型的类型
     */
    val type: AiModelTypeEnum,
) {

    /**
     * 用于缓存的唯一键
     */
    fun getCacheKey(): String {
        return hashCode().toString()
    }

}